export const readFile = (file) => {
    return new Promise((resolve) => {
        let reader = new FileReader();
        reader.readAsBinaryString(file);
        reader.onload = (ev) => {
            resolve(ev.target.result);
        };
    });
};
export const exportTabl = async (xlsx, file) => {
    console.log(file);
    let dataBinary = await readFile(file.raw);
    let workBook = xlsx.read(dataBinary, { type: "binary", cellDates: true });
    let sheet1 = workBook.Sheets[workBook.SheetNames[0]];
    let sheet2 = workBook.Sheets[workBook.SheetNames[1]];
    const data = [
        xlsx.utils.sheet_to_json(sheet1),
        xlsx.utils.sheet_to_json(sheet2),
    ];
    return data
};
